package com.example.demo.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-05-10
 * Time: 10:12
 */

// 创建一个 Person 类, 用于存储从配置文件中读取到的属性
@Component
@ConfigurationProperties(prefix = "person")
// prefix 表示属性的前缀。它指定了在配置文件中哪些以指定前缀开头的属性将会被映射到相应的 Java 对象中
@Getter
@Setter
@ToString
public class Person {
    private String name;
    private int age;
}
